package com.le.tester.book.concurrentjavafight.l6_1_2;

import java.net.ServerSocket;
import java.net.Socket;

/**
 * createTime：2022/10/15 10:05
 * description：为每一个任务提供一个线程（terrible）
 */
public class ThreadPerTaskWebServer {
    public static void main(String[] args) throws Exception {
        ServerSocket serverSocket = new ServerSocket(80);
        while (true) {
            final Socket socket = serverSocket.accept();

            Runnable task = () -> System.out.println("exec task");
            new Thread(task).start();
        }
    }

}
